﻿using System;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FwProject.Authorization.Users;
using FwProject.Core.FactoryInfo;
using FwProject.Core.DataFilterFactoryinfo;

namespace FwProject.Core.Car
{
    [Table("CarInfo")]
    public class CarInfo : FullAuditedEntity<Guid>, IHasFactroyinfo
    {

        /// <summary>
        /// 工厂
        /// </summary>
        public Guid? FactoryinfoId { get; set; }

        /// <summary>
        ///汽车主
        /// </summary>
        /// <value>The employee car user identifier.</value>
        [Required]
        public long EmployeeCarUserId { get; set; }
        [ForeignKey("EmployeeCarUserId")]
        public virtual User CarUser {get;set;}
        [Required]
        /// <summary>
        /// 车牌号
        /// </summary>
        /// <value>The plates number.</value>
        public string PlatesNumber { get; set; }
        /// <summary>
        /// 汽车类型
        /// </summary>
        /// <value>The type of the car.</value>
        [Required]
        public CarTypeEnum CarType { get; set; } = CarTypeEnum.小型卡车;
        [Required]
        /// <summary>
        /// 汽车吨位
        /// </summary>
        /// <value>The shopping ton.</value>
        public double ShoppingTon { get; set; } = 1.0;
        /// <summary>
        ///购买时间
        /// </summary>
        /// <value>The car old.</value>
        [Required]
        public DateTime CarOld { get; set; }
        /// <summary>
        /// 是否购买保险
        /// </summary>
        /// <value><c>true</c> if insurance; otherwise, <c>false</c>.</value>
        [Required]
        public bool Insurance { get; set; } = true;
   

    }
    public enum CarTypeEnum{
        [Display(Name = "小型卡车")]
        小型卡车=0,
        [Display(Name = "中型卡车")]
        中型卡车 =1,
        [Display(Name = "面包卡车")]
        面包卡车 = 2,
        [Display(Name = "货箱汽车")]
        货箱汽车 = 3,
    }
}
